<%-- 
    Document   : login
    Created on : Dec 18, 2012, 10:35:18 AM
    Author     : rzclau
--%>

<%-- 
    Document   : login
    Created on : Oct 8, 2012, 5:29:57 PM
    Author     : rzclau
--%>

<%@ page language="java" import="java.sql.*" %>
<html>
    <head>
        <meta charset="utf-8" />

        <title>Dashboard - COSTUME-IZER</title>

        <!-- Our CSS stylesheet file -->
        <link rel="stylesheet" href="portfolio/assets/css/styles.css" />
    </head>
    <nav id="filter">
        <%
            String txtuser = request.getParameter("Username");
            String txtpass = request.getParameter("Password");


            Connection con = null;
            Statement st = null;
            ResultSet rs = null;
            String url = "jdbc:mysql://localhost:3306/rbpl";
            String user = "root";
            String password = "";
            try {
                Class.forName("com.mysql.jdbc.Driver");
                con = DriverManager.getConnection(url, user, password);
                st = con.createStatement();
                rs = st.executeQuery("SELECT Username FROM userdetails where Username='" + txtuser + "' and Password=('" + txtpass + "')");
                if (rs.next()) {
                    HttpSession ses = request.getSession(true);
                    ses.putValue("ses_Username", txtuser);
                    out.println("Login Berhasil!!");
                    out.println(" Selamat Datang " + txtuser + " di Costume-izer ");
        %>
</nav>
        <br>
        <br>
        <a href=dashboard.jsp>Dashboard</a> ||
        <a href=notification.jsp>About Us</a>
        <header>
    <%
    } else {
        out.println("Login Salah! Isikan Username dan Password dengan benar");
    %>
    <br>
    <br>
    <br>
    <br>
    
    <p> Belum terdaftar? Silakan mendaftar<a href="signup2.jsp">disini</a></p>
    <%
            }
        } catch (Exception e) {
            out.println(e);
        }
    %>
        </header>
